package com.woniu.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.vo.PositionDetails;
import org.apache.ibatis.annotations.Select;

public interface PositionDetailsMapper extends BaseMapper<PositionDetails> {







    @Select("select p.position_id,\n" +
            "p.tname,\n" +
            "p.visit_count as position_visit_count ,\n" +
            "p.description,\n" +
            "p.salary,\n" +
            "p.lasalary,\n" +
            "p.statusc,\n" +

            "c.company_id,\n" +
            "c.`name`,\n" +
            "c.industry,\n" +
            "c.`status`,\n" +
            "c.visit_count as company_visit_count ,\n" +
            "p.hot,\n" +

            "u.id,\n" +
            "u.username\n" +
            "from t_position p\n" +
            "join t_user_position up \n" +
            "on p.position_id=up.pid\n" +
            "join t_user_company uc \n" +
            "on uc.user_id=up.uid\n" +
            "join t_company c\n" +
            "on c.company_id=uc.company_id\n" +
            "join t_user u\n" +
            "on u.id=uc.user_id  \n" +
            "${ew.customSqlSegment}")
    public IPage<PositionDetails> getPositionDetails(Page<PositionDetails> page, QueryWrapper<PositionDetails> ew);






}
